package com.demo.cloud.autoconfig.starter.service;

import com.demo.cloud.autoconfig.starter.properties.LuckyNumProperties;

import java.util.Random;

public class LuckyNumberService {
    /**自定义starter*/
    LuckyNumProperties luckyNum;

    public LuckyNumProperties getLuckyNum() {
        return luckyNum;
    }

    public void setLuckyNum(LuckyNumProperties luckyNum) {
        this.luckyNum = luckyNum;
    }

    public String getLuckyNum(String name) {
        Random random = new Random();
        return "<h1 align='center'>" + name + "，你的幸运数字为 <b style='color:red;font-size:39px;'>" + random.nextInt(luckyNum.getRange()) + "</b></center>";
    }
}
